<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Xml"%>

<%@ Import Namespace="beyondbit.Liuhq.WebControls"%>

<script runat="server">
void Page_Load(Object sender,EventArgs e)
{
	XmlDocument iDoc = new XmlDocument();
	iDoc.Load(Request.InputStream);
	
//	var str = "<xml><MetaDirName>" + d + "</MetaDirName></xml>";

	string metaDirName = iDoc.DocumentElement.SelectSingleNode("//MetaDirName").InnerText;
	
	string sqlSelectList = "";
	
	System.Text.StringBuilder sb = new System.Text.StringBuilder();
	sb.Append("<xml>");
	sb.Append("<data>");

	sqlSelectList = "Select * From MetaFiles Where MetaDirName='" + metaDirName + "' order by Sequence";
	DataSet dsDept = GetData.getDataSetBySql( sqlSelectList );
	if ( dsDept.Tables[0].Rows.Count > 0 )
	{
		foreach ( DataRow row in dsDept.Tables[0].Rows )
		{
			sb.Append("<childTree>");
			sb.Append("<MetaFilesID>"+row["ID"].ToString()+"</MetaFilesID>");
			sb.Append("<MetaFilesName>"+row["Name"].ToString()+"</MetaFilesName>");
			sb.Append("</childTree>");
		}
	}

	sb.Append("</data>");
	sb.Append("</xml>");
	
	
	string str = sb.ToString();
	XmlDocument oDoc = new XmlDocument();
	oDoc.LoadXml(str);

	Response.ContentType="text/xml";
	oDoc.Save(Response.OutputStream);
}
</script>